package com.telenav.localproxy.request;

import android.location.Location;

public class GpsEncryptRequest
{
   
    public Location convertGPSData(final Location gpsData)
    {
        if(gpsData == null)
        {
            return null;
        }
        
        int[] encFix = new int[3];
        int lat = (int) (gpsData.getLatitude() * 100000);
        int lng = (int) (gpsData.getLongitude() * 100000);
        
        int[] fix= new int[]{lat, lng, (int)(gpsData.getTime() / 1000)};
        encrypt(fix, encFix);
        
        gpsData.setLatitude(encFix[0] / 100000D);
        gpsData.setLongitude(encFix[1]/ 100000D);
        return gpsData;
    }
    
    public native boolean encrypt(int[] fix, int[] encFix);
}
